include ../Makefile.shared


define PROJ_acbn
  PPFLAGS = camlp4o pa_macro.cmo -UBNONLY
  SOURCES = parentParser.ml slearn.ml acbn.ml
  RESULT = acbn
endef
export PROJ_acbn



define PROJ_bnlean
  PPFLAGS = camlp4o pa_macro.cmo -DBNONLY
  SOURCES = parentParser.ml slearn.ml acbn.ml
  RESULT = bnlean
endef
export PROJ_bnlean

# If the environment does not define subprojects to handle,
# then set a default
ifndef SUBPROJS
  export SUBPROJS = acbn bnlearn
endif

export CPPFLAGS=camlp4o pa_macro.cmo -DBNONLY
export LIBS=ext str unix data expat mn bn circuit
CMXLIBS=ext.cmxa str.cmxa unix.cmxa data.cmxa expat.cmxa mn.cmxa bn.cmxa circuit.cmxa 
# Default target to use
all: nc
	ocamlopt -c -I ../../lib/ parentParser.ml 
	ocamlopt -c -I ../../lib/ slearn.ml
	ocamlopt -pp "camlp4o pa_macro.cmo -DBNONLY" -I ../../lib/ $(CMXLIBS) parentParser.cmx slearn.cmx acbn.ml -o bnlearn
	ocamlopt -pp "camlp4o pa_macro.cmo -UBNONLY" -I ../../lib/ $(CMXLIBS) parentParser.cmx slearn.cmx  acbn.ml -o acbn
	cp $(SUBPROJS) $(BINDIR)
	
	
# Catch-all target will be applied to all subprojects automatically
%:
	#@$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@
